package ar.com.spsolutions.splilabrary.view.pages.book;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.CompoundPropertyModel;

import ar.com.spsolutions.splibrary.book.BookComment;

/**
 * TODO: description
 */
public class BookCommentPanel extends Panel {

    private static final long serialVersionUID = 7566548503154677857L;

    private BookComment bookComment;

    // public BookCommentPanel(final String id) {
    public BookCommentPanel(final String id, final BookComment bookComment) {
        super(id);
        this.bookComment = bookComment;
        initialize();
    }

    private void initialize() {
        final Form<BookComment> form = new Form<BookComment>("panel", new CompoundPropertyModel<BookComment>(
                getBookComment()));
        form.add(new Label("user"));
        // form.add(new Label("date"));
        form.add(new TextArea<String>("text").setEnabled(false));
        this.add(form);

    }

    public BookComment getBookComment() {
        return bookComment;
    }

    public void setBookComment(final BookComment bookComment) {
        this.bookComment = bookComment;
    }

}
